package com.kyhd.audio.service;

import java.io.InputStream;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.kyhd.audio.util.AppConfig;
import com.kyhd.audio.util.UploadOSS;

@Service
public class OSSService {
	
	@Autowired(required=true)
	AppConfig appConfig;
	
	/**
	 * 上传文件到阿里云OSS服务器,
	 * @param prefixPath
	 * @param strdate
	 */
	public String uploadCommon(InputStream inputStream, String fileName) {
		String path = UploadOSS.uploadCommon(inputStream, appConfig.getFilePrefix(), fileName,
				appConfig.getEndPoint(), appConfig.getAccessKeyId(), appConfig.getAccessKeySecret(), appConfig.getBucketName());
		return  path;
	}
	
}
